import { createRouter, createWebHistory } from 'vue-router';
import MyComponent1 from '@/components/MyComponent1.vue'
import MyComponent2 from '@/components/MyComponent2.vue'
import MyComponent3 from '@/components/MyComponent3.vue'
const routes = [
    {
        path: '/component1',
        name: 'MyComponent1',
        component: MyComponent1
    },
    {
        path: '/component2',
        name: 'MyComponent2',
        component: MyComponent2
    },
    {
        path: '/component3',
        name: 'MyComponent3',
        component: MyComponent3
    },
    {
        path: '/',
        redirect: '/component1' // 可选：为未匹配到的路径设置重定向
    }
]
// 创建路由实例并传递 `routes` 配置
const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes,
});

export default router;